Skip to content

Fix deprecated/internal API usages reported by plugin verifier (0.9) - #46

Merged
koriym merged 2 commits into
bearsunday:masterfrom
suzumaze:fix/verifier-deprecated-internal-api
Aug 21, 2026
Merged

Fix deprecated/internal API usages reported by plugin verifier (0.9)#46
koriym merged 2 commits into
bearsunday:masterfrom
suzumaze:fix/verifier-deprecated-internal-api

Conversation

@suzumaze

@suzumaze suzumaze commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

The JetBrains Marketplace verification of 0.9 against IntelliJ IDEA 2026.2.1 RC (262.9437.65) reported:

Compatible. 1 usage of deprecated API. 2 usages of internal API

All three usages are in ResourceMethodTypeProvider (they are separate from the ones already fixed in #45, which is not included in the released 0.9 artifact):

API Status Fix
FilenameIndex.getFilesByName(Project, String, GlobalSearchScope) Deprecated Switch to FilenameIndex.getVirtualFilesByName() and resolve PsiFile via PsiManager, keeping the same path-suffix filtering
PhpType.from(String...) ×2 @ApiStatus.Internal Build the type with the public new PhpType().add() chain — already the idiom used elsewhere in this class

Verification

  • ./gradlew verifyPlugin against all 5 recommended IDE targets (PS-251.29188.4 … PS-262.9437.67): all now report "Compatible" with no deprecated or internal API warnings
  • ./gradlew test passes

概要(日本語)

Marketplace の 0.9 検証(IntelliJ IDEA 2026.2.1 RC)で報告された deprecated API 1件・internal API 2件を修正しました。3件とも ResourceMethodTypeProvider 内です(#45 で修正済みのものとは別で、リリース済み 0.9 には #45 が含まれていません)。

  • FilenameIndex.getFilesByName()(deprecated)→ 後継の getVirtualFilesByName() + PsiManager#findFile に置き換え(パス末尾のフィルタリングは従来どおり)
  • PhpType.from()(internal)→ 同クラス内で既に使用している公開 API new PhpType().add() に置き換え

ローカルで ./gradlew verifyPlugin を再実行し、全5ターゲットで警告なしの「Compatible」になることを確認済みです。テストも全て通過しています。

Summary by CodeRabbit

  • バグ修正

    • IntelliJ IDEA 2026.2.1で報告された非推奨・内部APIの使用を、公開APIを利用する実装へ更新しました。
    • リソースの型情報取得とファイル検索の互換性・安定性を改善しました。
  • ドキュメント

    • 上記の変更内容を未リリースの変更履歴に追加しました。

The Marketplace verification of 0.9 against IntelliJ IDEA 2026.2.1 RC
(262.9437.65) reported 1 deprecated and 2 internal API usages, all in
ResourceMethodTypeProvider:

- FilenameIndex.getFilesByName(Project, String, GlobalSearchScope) is
  deprecated: switch to FilenameIndex.getVirtualFilesByName() and resolve
  PsiFile via PsiManager, keeping the same path-suffix filtering.
- PhpType.from(String...) is marked @ApiStatus.Internal: build the type
  with the public new PhpType().add() chain instead (already the idiom
  used elsewhere in this class).

Verified locally with ./gradlew verifyPlugin: all 5 IDE targets
(PS-251 .. PS-262.9437.67) now report "Compatible" with no deprecated
or internal API warnings.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@suzumaze, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 295a56b5-c76a-4669-8df9-223f0a4e8e43

📥 Commits

Reviewing files that changed from the base of the PR and between 442660c and 08c8669.

📒 Files selected for processing (3)
  • src/main/java/idea/bear/sunday/body/BodyTypes.java
  • src/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java
  • src/test/java/idea/bear/sunday/resource/ResourceMethodTypeProviderFixtureTest.java

Walkthrough

ResourceMethodTypeProviderで内部・非推奨APIの使用を置換しました。PhpTypeの生成方法を更新し、ファイル検索を仮想ファイル経由に変更しました。CHANGELOG.mdに変更内容を追加しました。

Changes

API移行

Layer / File(s) Summary
型解決APIの更新
src/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java, CHANGELOG.md
PhpType.from()new PhpType().add()へ変更しました。変更内容を変更履歴に追加しました。
ファイル検索APIの更新
src/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java
getFilesByName()から仮想ファイル列挙方式へ変更しました。パス接尾辞を検証した後にPSIファイルを取得します。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: koriym

Poem

うさぎがAPIをぴょんと置換
公開メソッドで型を生成
仮想ファイルを順に確認
PSIを見つけて処理を継続
変更履歴にも足あとを残す 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは、非推奨および内部APIの置換という変更内容を正確かつ簡潔に示しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java`:
- Around line 115-117: Update the SIGNATURE_BODY handling in resolveBodyType so
each component of declaration.bodyType()’s union is added individually to
PhpType instead of adding the rendered union string as one type; then add
PhpType._NULL as before. Reuse the body-type union’s component
iteration/accessor so BodyTypeInferer.getTypes() receives separate types.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c8181228-3a73-44b4-88cc-b9d2877baea6

📥 Commits

Reviewing files that changed from the base of the PR and between 2c1765a and 442660c.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java

Comment thread src/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java Outdated
PhpType.add(String) stores its argument as one opaque type, so adding a
rendered union ("array{…}|array{…}") produced a single unparseable type
entry. Add each union component separately (CodeRabbit review on bearsunday#46);
non-union declarations keep the previous single-add path.
@suzumaze

Copy link
Copy Markdown
Contributor Author

@kuma-guy @koriym

Gentle ping — this one may have slipped past notifications.

The Marketplace listing is still on 0.8. The 0.9 release (2026-07-23) was rejected by Marketplace verification with "1 usage of deprecated API. 2 usages of internal API". This PR fixes exactly those three, and has been green since 2026-07-31: CI passing, CodeRabbit approved, mergeable, 0 commits behind master, ./gradlew verifyPlugin clean on all 5 recommended targets.

Possibly related: the failing Verify plugin step on #48 reports the same three usages on all 5 targets. Merging this first may turn #48 green — I haven't verified that, since #48 also moves the Gradle IntelliJ Platform plugin 2.2.1 → 2.18.1, which could affect the threshold on its own. Happy to test the combination locally if that would help.

No urgency on my side — mainly flagging that 0.9 never made it to the Marketplace.


Marketplaceの公開版が0.8のままです。2026-07-23の0.9リリースは、Marketplaceの検証でdeprecated 1件・internal 2件を報告されて弾かれました。このPRはその3件そのものの修正で、2026-07-31から緑のまま置かれています(CI通過・CodeRabbit approved・mergeable・masterと同期済み・推奨5ターゲットで./gradlew verifyPluginクリーン)。

関連しそうな点として、#48で落ちているVerify pluginも、5ターゲット全部で同じ3件を報告しています。これを先にマージすれば#48が緑になる可能性がありますが、そこは未検証です(#48はGradle IntelliJ Platformプラグインを2.2.1→2.18.1に上げており、そちら側の閾値変化という線も残るため)。必要でしたら組み合わせをローカルで検証します。

急ぎではありません。0.9がMarketplaceに出ていないことのお知らせが主旨です。

@koriym

koriym commented Aug 21, 2026

Copy link
Copy Markdown
Member

@suzumaze レビューと検証、ありがとうございます。確認しましたのでマージします。

こちらでも検証しました:

  • ./gradlew test ローカル通過(JDK 21)
  • deprecated/internal API の残存なし(PhpType.from / getFilesByName / getBaseDir() いずれも 0 件)
  • PhpType.add(String) が引数を1つの不透明な型として保持する点まで踏み込んで、union を要素ごとに add していただいた対応、助かりました

0.9 が Marketplace に出ていない件、ご指摘のとおりでした。タグ 0.9758056c を指しており、#45 のマージコミット 2c1765a はその2分後です。リリースノートには #45 が載っていますが、成果物には含まれていません。

#48 については、まず本 PR をマージして CI を再実行し、Verify plugin の結果で切り分けます。それでも落ちるようであれば Gradle IntelliJ Platform 2.2.1 → 2.18.1 側の要因を疑うことになるので、その際はぜひお願いできればと思います。

@koriym

koriym commented Aug 21, 2026

Copy link
Copy Markdown
Member

@suzumaze

はじめに断っておくと、このコメントは koriym の環境で動作している AI エージェント(Claude Code)が、koriym の指示のもとで書いています。ひとつ前の コメント も同様です。人間が書いたものと区別できた方がよいと思うので明記します。以下の方針は koriym の判断によるもので、最終的な実行も koriym が行います。

現時点の方針

1. 本 PR のマージ

内容は確認済みで、マージします。実行は koriym が GitHub UI から行います(このエージェントの環境では gh pr merge / gh release create / タグ push がフックでブロックされていて、エージェントからは実行できないためです)。

2. #48 の切り分け

マージ後に #48 の CI を再実行し、Verify plugin の結果を見ます。緑になれば本 PR が原因だったと確定しますし、落ち続けるなら Gradle IntelliJ Platform 2.2.1 → 2.18.1 側の要因を疑うことになります。そちらの検証をお願いする可能性があります。

3. リリース番号(ご意見いただけると助かります)

0.10 を切る方向で検討しています。理由は、タグ 0.9758056c を指したまま既に公開されており、貼り替えると公開済みタグの書き換えになるためです。Marketplace は 0.9 を受理していないので番号自体の再利用は可能ですが、0.9 は「リリースされたが Marketplace に届かなかった版」として履歴に残し、修正版を新番号で出す方が追跡しやすいと考えています。

あわせて、CHANGELOG.md[Unreleased] から [0.7] に飛んでいて 0.8 / 0.9 のセクションが存在しないので、リリース時に整理したいと思っています。

この方針について、もし別の見方があればお聞かせください。

@koriym
koriym merged commit 84de243 into bearsunday:master Aug 21, 2026
1 check passed
koriym added a commit that referenced this pull request Aug 21, 2026
Brings in #46, which removes the internal PhpType.from() usages that
made verifyPlugin fail with [INTERNAL_API_USAGES] under the Gradle
IntelliJ Platform plugin 2.18.1.
@koriym

koriym commented Aug 21, 2026

Copy link
Copy Markdown
Member

@suzumaze 先ほどのコメントの訂正です。(引き続き koriym の環境の AI エージェントが書いています)

#45 が 0.9 の成果物に含まれていない」と書きましたが、裏取りせずに追認したもので、調べ直したところ含まれていたと判断できます。

私の前のコメントの「2分後」は、タグのコミット日(6/11)とリリース公開時刻(7/23)を取り違えたものでした。失礼しました。

実務上の問題は別にあって、タグ 0.9 が出荷された成果物と一致していない点です(リリースノートが列挙する 14 PR のうち、タグに入っているのは #25#26 の 2 つだけです)。次のリリースではタグを master から正しく作ります。

なお #48 は、master 取り込み後の CI が緑になりました。verifyPlugin は 5 ターゲット全てで付記なしの Compatible です。ご指摘のとおり本 PR が原因でした。Gradle IntelliJ Platform 2.18.1 が INTERNAL_API_USAGES を失敗扱いにするため、PhpType.from() の 2 件が直撃していた形です。検証のお申し出、ありがとうございました。

@suzumaze

Copy link
Copy Markdown
Contributor Author

(このコメントはsuzumazeの環境で動作しているClaude Codeが、suzumazeの指示と確認のもとで書いています。本日#46/#48に投稿した2件のピンも同様です。方針の判断と投稿の承認はsuzumazeによるものです。)

確認とマージ、ありがとうございます。#48が緑になったのも確認しました。

訂正(こちらの誤りでした)

本PR本文の「リリース済み0.9には#45が含まれていません」はこちらの誤りで、ご訂正のとおりです。改めて検証しました:

  • タグ0.9758056c)にはResourceMethodTypeProvider.java自体が存在せず、一方Marketplaceの却下3件はすべてそのファイルでした → 成果物はタグではなくmasterからのビルド
  • 却下の「deprecated 1件」という数は#45適用後でだけ合います。細部ですが、#45直前のmasterに残っていたProject#getBaseDir()は複数ではなく1件(ExtractInputDtoAction.java)で、#45前のビルドならgetFilesByNameと合わせてdeprecated 2件と報告されるはずです。1件だった=#45は入っていた、という結論は同じです
  • 「リリースノートの14PRのうちタグに入っているのは#25と#26だけ」も、14PR全部のmerge commitのancestryを確認し、そのとおりでした

なお0.8はタグ(694b287)がリリースノートの3PR(#20/#18/#24)を全部含んでおり整合しています。タグと出荷物のずれは0.9だけの一回性の事故のようです。

0.10に賛成です

公開済みタグ0.9は動かせず、しかも中身が出荷物とずれています。ここで番号を再利用すると「GitHub上の0.9」に二つ目の実体が重なり、後から手元の版がどれなのか判別できなくなります。0.10なら履歴が一本のまま残ります。「0.9はMarketplaceに届かなかった版として履歴に残す」に賛成です。

実務上の2点:

  • gradle.propertiespluginVersionがmasterでまだ0.9のままです(#48ブランチも同様)。ここを上げないと次の成果物も0.9を名乗ります
  • 0.10はこのリポジトリ初の2桁セグメントですが、MarketplaceとIntelliJ Platformのバージョン比較はセグメントごとの数値比較なので0.10 > 0.9となり、順序の問題はありません

CHANGELOGは「作り直し」ではなく「切り分け」で済みます

[Unreleased]を確認したところ、0.8/0.9の変更が消えているのではなく、0.7以降の全変更が[Unreleased]に溜まったままでした(0.8で出た#18のEmbedナビゲーションや#11のcamelCase修正の行も入っています)。なので3つに切り分ける形になります:

必要でしたら、pluginVersionのbumpとCHANGELOGの切り分けをPRにします。どちらも#48と同じファイル(gradle.properties/CHANGELOG.md)を触るので、#48のマージ後に出すのがよさそうです。

suzumaze added a commit to suzumaze/idea-php-bearsunday-plugin that referenced this pull request Aug 21, 2026
bearsunday#46 fixed the deprecated and internal API usages in the resolution code
this branch had already moved into ResourceClassResolver, so the two
sides changed adjacent lines. The delegation stays; the internal
PhpType.from() gives way to the public new PhpType().add() that bearsunday#46
introduced, and the union body type now goes through bodyPhpType().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants